import request from '/@/utils/request';

// 开票管理
// 开票统计

export const fetchInvoiceStatics =  (data?: object) => {
	return request({
		url: '/order/invoice/getStatusCount',
		method: 'post',
		data,
	});
}

// 开票列表
export const fetchInvoiceList =  (data?: object) => {
	return request({
		url: '/order/invoice/getPage',
		method: 'post',
		data,
	});
}

// 下载发票
export const fetchInvoiceDown =  ( data:any) => {
	return request({
		url: data?.url,
		method: 'get',
		responseType: 'blob',
		data,
	});
}

// 导出
export const fetchInvoiceExport =  (data?: object) => {
	return request({
		url: '/order/invoice/export',
		method: 'post',
		responseType: 'blob',
		data,
	});
}


//---- 财务管理 -----
// zft列表
export const fetchAlipayList =  (params?: object) => {
	return request({
		url: '/user/zft/page',
		method: 'get',
		params,
	});
}

// zft导出
export const fetchAlipayExport =  (data?: object) => {
	return request({
		url: '/user/zft/export',
		method: 'post',
		responseType: 'blob',
		data,
	});
}

//sft列表
export const fetchSFTList =  (params?: object) => {
	return request({
		url: '/user/sft/page',
		method: 'get',
		params,
	});
}

// sft导出
export const fetchSFTExport =  (data?: object) => {
	return request({
		url: '/user/sft/export',
		method: 'post',
		responseType: 'blob',
		data,
	});
}

// 经销商认证
// 统计
export const fetchDealerAuthStatics =  (params?: object) => {
	return request({
		url: '/dealer/count',
		method: 'get',
		params,
	});
}

// 列表
export const fetchDealerAuthList =  (params?: object) => {
	return request({
		url: '/dealer',
		method: 'get',
		params,
	});
}

// 审核
export const fetchDealerAuthAudit = (data:any) => {
	return request({
		url: '/dealer/check',
		method: 'post',
		data,
	});
};
